from common.base_page import BasePage
from time import sleep
from appium.webdriver.common.appiumby import AppiumBy


class ConcernedPage(BasePage):
    # 返回按钮
    btn_back = (AppiumBy.ID, 'com.jhss.youguu:id/btn_back')
    ''''点击聊股'''
    btn_desktop_talk = (AppiumBy.ID, 'com.jhss.youguu:id/btn_desktop_talk')
    # 关注
    tv_focus = (AppiumBy.ID, 'com.jhss.youguu:id/tv_focus')
    #点击发现
    btn_desktop_discovery=AppiumBy.ID,'com.jhss.youguu:id/btn_desktop_discovery'
    #点击头像
    head_pic=AppiumBy.ID,'com.jhss.youguu:id/head_pic'
    #已关注
    TextView=AppiumBy.ID,'com.jhss.youguu:id/tv_focus_num'
    #添加关注成功
    Toast=AppiumBy.XPATH,'/hierarchy/android.widget.Toast'


    def concerned(self):
        '''点击聊股'''
        self.click_ele(self.btn_desktop_talk)
        sleep(2)
        # 点击关注
        self.click_ele(self.tv_focus)
        sleep(5)


        #点击发现
        self.click_ele(self.btn_desktop_discovery)
        sleep(2)
        #点击头像
        self.click_ele(self.head_pic)
        sleep(2)
